/* static/css/style.css */

/* 重置默认样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #6a11cb 0%, #2575fc 100%);
    color: #333;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* 导航栏 */
.navbar {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    position: sticky;
    top: 0;
    z-index: 100;
}
.nav-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 60px;
}
.logo {
    color: #6a11cb;
    text-decoration: none;
    font-weight: bold;
    font-size: 1.4rem;
}
.nav-links a {
    margin: 0 15px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
}
.nav-links a:hover {
    color: #6a11cb;
}

/* 主内容区 */
.main-content {
    flex: 1;
    max-width: 1200px;
    margin: 30px auto;
    padding: 0 20px;
    width: 100%;
}

.page-container {
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.page-container h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #6a11cb;
}

/* 按钮通用样式 */
.btn {
    display: inline-block;
    padding: 12px 24px;
    background: #007bff;
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: bold;
    transition: all 0.3s;
    border: none;
    cursor: pointer;
    font-size: 1rem;
    width: 100%;
}
.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    background: #0056b3;
}

.btn:active {
    transform: translateY(0);
}

.btn-secondary {
    background: #6c757d;
}

.btn-secondary:hover {
    background: #5a6268;
}

/* 表单通用样式 */
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
}
.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    transition: border 0.3s;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: #007bff;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

/* 认证页面样式 */
.auth-container {
    max-width: 500px;
    margin: 0 auto;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 15px;
    padding: 40px;
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
}

.auth-container h1 {
    text-align: center;
    margin-bottom: 30px;
    color: #6a11cb;
}

.auth-form {
    margin-bottom: 20px;
}

.auth-switch {
    text-align: center;
    margin-top: 20px;
}

.auth-switch a {
    color: #007bff;
    text-decoration: none;
    font-weight: 500;
}

.auth-switch a:hover {
    text-decoration: underline;
}

/* 消息提示样式 */
.message {
    padding: 12px;
    margin-bottom: 20px;
    border-radius: 5px;
    text-align: center;
    display: none;
}

.message.success {
    background-color: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.message.error {
    background-color: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* 故事生成页面样式 */
.story-form {
    max-width: 600px;
    margin: 0 auto 30px;
}

.story-result {
    background: rgba(255, 255, 255, 0.8);
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
    display: none;
}

.story-result h2 {
    color: #6a11cb;
    margin-bottom: 15px;
}

.story-result p {
    line-height: 1.6;
    margin-bottom: 20px;
}

/* 首页故事列表样式 */
.tabs-container {
    margin-bottom: 30px;
}

.tabs {
    display: flex;
    list-style: none;
    border-bottom: 2px solid #eee;
    flex-wrap: wrap;
}

.tab {
    padding: 12px 20px;
    cursor: pointer;
    font-weight: 500;
    color: #666;
    transition: all 0.3s;
    border-bottom: 3px solid transparent;
}

.tab:hover {
    color: #6a11cb;
}

.tab.active {
    color: #6a11cb;
    border-bottom: 3px solid #6a11cb;
}

.stories-container {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
}

.story-card {
    background: rgba(255, 255, 255, 0.9);
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.08);
    transition: transform 0.3s;
}

.story-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}

.story-card h3 {
    color: #333;
    margin-bottom: 10px;
}

.story-excerpt {
    color: #666;
    line-height: 1.5;
    margin-bottom: 15px;
}

.story-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.85rem;
    color: #999;
}

.category {
    background: #6a11cb;
    color: white;
    padding: 3px 8px;
    border-radius: 15px;
    font-size: 0.8rem;
}

/* 页脚 */
.footer {
    text-align: center;
    padding: 20px;
    color: white;
    font-size: 0.9rem;
    margin-top: auto;
}

/* 加载动画 */
.loading {
    text-align: center;
    color: #666;
    font-style: italic;
    margin: 20px 0;
    display: none;
}

.spinner {
    border: 4px solid rgba(0, 0, 0, 0.1);
    border-left-color: #007bff;
    border-radius: 50%;
    width: 30px;
    height: 30px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 响应式设计 */
@media (max-width: 768px) {
    .nav-container {
        flex-direction: column;
        height: auto;
        padding: 10px;
    }
    
    .nav-links {
        margin-top: 10px;
    }
    
    .nav-links a {
        margin: 0 10px;
        font-size: 0.9rem;
    }
    
    .tabs {
        justify-content: center;
    }
    
    .tab {
        padding: 10px 15px;
        font-size: 0.9rem;
    }
    
    .stories-container {
        grid-template-columns: 1fr;
    }
    
    .auth-container {
        margin: 10px;
        padding: 20px;
    }
}